<!DOCTYPE html>
<html lang="en">
<head>
    <style>
    body,p{padding: 0;margin: 0;}
    p{
        font-size: 30px;
        display: block;
        width: 980px;
        background-color: blue;
        color: white;
    }
    </style>
</head>
<body>
    <input type="text" name="t1" value='123'><br>
    <input type="text" name="t2"><br>
    <input type="text" name="t3"><br>
    <input type='button' onclick='test()' value='add'/>
    <script type="text/javascript">
        function test(){
            var t1 = document.getElementsByName('t1')[0];
            var t2 = document.getElementsByName('t2')[0];
            var t3 = document.getElementsByName('t3')[0];
            alert(parseInt(t1.value)+parseInt(t2.value));
        }
    </script>
</body>
</html>